package top.lingkang.fv.solon;

import org.noear.solon.Solon;
import top.lingkang.finalvalidated.core.FinalValidatorFactory;
import top.lingkang.finalvalidated.handle.CustomValidHandle;

import java.lang.annotation.Annotation;

/**
 * @author lingkang
 * created by 2025-11-10
 */
public class FinalValidatorFactorySolon extends FinalValidatorFactory {

    @Override
    public void addCustom(Class<? extends Annotation> annotation, Class<? extends CustomValidHandle> validHandle) {
        super.addCustom(annotation, validHandle);
        InterceptorFinalValidator interceptor = Solon.context().getBean(InterceptorFinalValidator.class);
        Solon.context().beanInterceptorAdd(annotation, interceptor, 666);
        interceptor.clearCache();
    }
}
